import request from './request'
interface WorthBuyBannerItem{
    columnUrl: string,
    id: number,
    mainTitle: string,
    onlineType: boolean,
    picUrl: string,
    rank:number,
    vaildEndTime:number
    vaildStartTime:number
    viceTitle:string
}
export type navListData = WorthBuyBannerItem[]
export type WorthBuyBannerData = {
    navList: navListData,

}
interface WorthBuyBannerListData {
    code: string,
    data: WorthBuyBannerData
}

interface topicData {
    topicId: string,
    nickname: string,
    picUrl: string,
    title: string,
    avatar: string,
    categoryIds: string,
    subTitle: string,
    readCount:string
}
export type topicsListData = topicData[]

interface resultData {
    topics: topicsListData
}
type resultListData = resultData[]

type resListData = {
    code: string,
    data: {
        result:resultListData
    }
}

export default {
    // 获取值得买页面轮播图数据
    reqWorthBuyBannerList() {
        return request.get<any, WorthBuyBannerListData>('topic/v1/know/navWap.json')
    },
    // 获取瀑布流的数据
    reqWorthBuyItemList() {
        return request.get<any, resListData>('topic/v1/find/recAuto.json?page=10&size=2&exceptIds=')
    }
}